using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;
using EmailBodyTable = CentralOffice.MyTable.Data.EmailDataSet.EmailBodyDataTable;
using EmailBodyRow = CentralOffice.MyTable.Data.EmailDataSet.EmailBodyRow;
namespace CentralOffice.MyTable.DataAccess
{
    public class EmailBodyAdapter : DataAccessAdapter<MyTable.Data.EmailDataSet, EmailBodyTable, EmailBodyRow>
    {
        public EmailBodyAdapter()
        {
            this.TableName = "EmailBody";
            DeleteStoredProc = "EmailBody_DeleteEmailBody";

            GetAllStoredProc = "EmailBody_SelectEmailBodyAll";
            DeleteStoredProc = "EmailBody_DeleteEmailBody";
            InsertStoredProc = "EmailBody_InsertEmailBody";
            UpdateStoredProc = "EmailBody_UpdateEmailBody";
            FindStoredProc = "EmailBody_SelectEmailBodyDynamic";
            GetByIdStoredProc = "EmailBody_SelectEmailBody";
            GetPagedStoredProc = "EmailBody_SelectEmailBodyPaged";
            GetRowCountStoredProc = "EmailBody_SelectEmailBodyRowCount";
        }

        protected override void PopulateInsertParameters(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromId", DbType.String, "FromId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.String, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "CopyToId", DbType.String, "CopyToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "SecretToId", DbType.String, "SecretToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "Subject", DbType.String, "Subject", DataRowVersion.Current);
            db.AddInParameter(cmd, "Content", DbType.String, "Content", DataRowVersion.Current);
            db.AddInParameter(cmd, "SendTime", DbType.DateTime, "SendTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachmentId", DbType.String, "AttachmentId", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachmentName", DbType.String, "AttachmentName", DataRowVersion.Current);
            db.AddInParameter(cmd, "SendFlag", DbType.String, "SendFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "SmsRemind", DbType.String, "SmsRemind", DataRowVersion.Current);
            db.AddInParameter(cmd, "Importants", DbType.String, "Importants", DataRowVersion.Current);
            db.AddInParameter(cmd, "Size", DbType.Decimal, "Size", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromWebMail", DbType.String, "FromWebMail", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToWebMail", DbType.String, "ToWebMail", DataRowVersion.Current);

            db.AddInParameter(cmd, "FromEmp", DbType.String, "FromEmp", DataRowVersion.Current);
        }
    }
}
